package leetcode;

import java.sql.SQLOutput;
import java.util.Scanner;

public class Main {
    static  final int Mod=998244353;
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int n=scanner.nextInt();
        int k=scanner.nextInt();
        int[] dp=new int[n+1];
        dp[0]=1;
        for (int l=2;l<=n;l+=2){
            for (int j=0;j<l;j+=2){
                dp[l]=(dp[l]+(k*dp[j]%Mod*dp[l-2-j]%Mod)%Mod)%Mod;
            }
        }
        System.out.println(dp[n]);
    }
}
